package com.course.designpatterns.strategy;

/**
 * @author ：Jack Hao
 * @date ：Created in 2021/6/20 21:58
 * @description：
 */
public class Dog implements MyComparable<Dog>
{
    int food;
    public Dog(int food){
        this.food = food;
    }

    @Override
    public int compareTo(Dog d)
    {
        if(this.food<d.food) return 1;
        else if(this.food > d.food) return -1;
        else return 0;
    }

    @Override
    public String toString()
    {
        return "Dog{" +
                "food=" + food +
                '}';
    }

}
